/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.upc.sigu.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Usuario2
 */
@Embeddable
public class PersonalPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "institucion")
    private int institucion;
    @Basic(optional = false)
    @Column(name = "personal")
    private String personal;
    

    public PersonalPK() {
    }

    public PersonalPK(int institucion, String personal) {
        this.institucion = institucion;
        this.personal = personal;
    }

    public int getInstitucion() {
        return institucion;
    }

    public void setInstitucion(int institucion) {
        this.institucion = institucion;
    }

    public String getPersonal() {
        return personal;
    }

    public void setPersonal(String personal) {
        this.personal = personal;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) institucion;
        hash += (personal != null ? personal.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PersonalPK)) {
            return false;
        }
        PersonalPK other = (PersonalPK) object;
        if (this.institucion != other.institucion) {
            return false;
        }
        if ((this.personal == null && other.personal != null) || (this.personal != null && !this.personal.equals(other.personal))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.upc.sigu.entities.PersonalPK[institucion=" + institucion + ", personal=" + personal + "]";
    }

}
